<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2-metronic.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/css/pages/timeline.css"/>
    <link href="${path}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
    <link href="${path}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
</head>
<body class="page-header-fixed">
<jsp:include page="../common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
    <div class="page-sidebar-wrapper"><jsp:include page="../common/menu.jsp"/></div>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet box purple">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-globe"></i>企业会员信息列表
                            </div>
                            <div class="tools">
                                <div class="actions">
                                    <a href="${path}/member/add?userType=1" class="btn blue">新增</a>
                                    <a href="${path}/member/downExcel?userType=1" target="_blank" class="btn blue">导出Excel</a>
                                </div>
                            </div>
                        </div>
                        <div class="portlet-body">
                            <form id="formQuery" class="form-horizontal" action="${path}/member/init">
                                <div class="form-body">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <select id="keyType" name="keyType" class="form-control">
                                                <option value="userName">用户名</option>
                                                <option value="mobile">手机号</option>
                                            </select>
                                        </div>
                                        <div class="col-md-3">
                                            <input id="keywords" name="keywords" class="form-control"/>
                                        </div>
                                        <label class="col-md-2 control-label">注册时间:</label>

                                        <div class="col-md-4">
                                            <div class="input-group input-large date-picker input-daterange"
                                                 data-date-format="yyyy-mm-dd">
                                                <input type="text" class="form-control" id="fromDate" name="fromDate">
                                                <span class="input-group-addon">to</span>
                                                <input type="text" class="form-control" id="toDate" name="toDate">
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                            <input type="hidden" name="userType" value="1">
                                            <button type="button" class="btn green" onclick="getMemberList()">查询</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <table class="table table-striped table-bordered table-hover" id="dataList"></table>
                            <div id="panel" class="modal fade" tabindex="-1" data-backdrop="static"
                                 data-keyboard="false">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"></button>
                                            <h4 class="modal-title">会员充值</h4>
                                        </div>
                                        <div class="modal-body">
                                            <form class="form-horizontal form-row-seperated" id="panelForm">
                                                <div class="portlet-body">
                                                    <div class="tabbable">
                                                        <div class="tab-content no-space">
                                                            <div class="tab-pane active" id="tab_general">
                                                                <div class="form-body">
                                                                    <div class="form-group">
                                                                        <label class="col-md-3 control-label">会员姓名:</label>
                                                                        <div class="col-md-5">
                                                                            <span id="memberName"></span>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-md-3 control-label">充值S币数:</label>
                                                                        <div class="col-md-5">
                                                                            <input type="hidden" id="memberid" name="id"
                                                                                   class="form-control"/>
                                                                            <input type="hidden" name="type" value="1"/>
                                                                            <input type="text" id="money" name="value"
                                                                                   class="form-control"/>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn default" data-dismiss="modal">关闭</button>
                                            <button type="button" class="btn blue" id="btnPanel">提交</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
<script type="text/javascript" src="${path}/member/js/corp.js"></script>
<script type="text/javascript">
    var msg = '${msg}';
    $(function () {
        if(msg) {
            App.bubble(200, msg);
        }
        $("#btnPanel").click(function () {
            App.ajax(_path + "/member/oper", $("#panelForm").serialize(), function (data) {
                if (data && data.statusCode === 200) {
                    $('#panel').modal('hide');
                    oper(2);
                }
            });
        });
        getMemberList();
    });
</script>
</body>
</html>